<?php

use Fisharebest\Webtrees\I18N;

?>

<div class="wt-tab-stories py-4">
    <?php foreach ($stories as $story) : ?>
        <div class="story_title descriptionbox text-center rela">
            <?= e($story->title) ?>
        </div>
        <div class="story_body optionbox">
            <?= $story->story_body ?>
        </div>
        <?php if ($is_admin) : ?>
            <div class="story_edit">
                <a href="<?= e(route('module', ['module' => 'stories', 'action' => 'AdminEdit', 'block_id' => $story->block_id, 'tree' => $tree->name()])) ?>">
                    <?= I18N::translate('Edit the story') ?>
                </a>
            </div>
        <?php endif ?>
    <?php endforeach ?>

    <?php if ($is_admin && $stories === []) : ?>
        <div>
            <a href="<?= e(route('module', ['module' => 'stories', 'action' => 'AdminEdit', 'xref' => $individual->xref(), 'tree' => $tree->name()])) ?>">
                <?= I18N::translate('Add a story') ?>
            </a>
        </div>
    <?php endif ?>
</div>
